cutree(model,h=NULL,k=NULL)
(a) (b)
Cutting a tree by specifying the maximum height of subtrees. (a) Before the
After the cutting.
ose a hanging tree is shown in Figure 2.18(a) and the tree has been
a variable called model. This tree can be cut to generate subtrees
maximum subtree height as two using the following code. The
subtrees are shown in Figure 2.18(b), where it can be seen that
as led to three clusters, i.e., a cluster of data point labelled by A,
of data points labelled by B and C as well as a cluster of data
belled by D and E.
cutree(model,h=2)
ging tree can also be cut for a specified cluster number. The code
low cuts a hanging tree into two clusters. Figure 2.19 shows the
cutree(model,k=2)
(a) (b)
Cutting a tree by specifying the number of clusters. (a) Before the cutting.
e cutting.